<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/views/commons/taglibs.jsp" %>
<div class="panel-heading">
	<div class="pull-right">
		<a href="<%=path %>/admin/goods/toInsert" target="_blank">新增商品</a>
	</div>
	<h3 class="panel-title">商品列表</h3>
</div>
<div class="bd clearfix">
	<form id="admin_goods_choose_form" action="javascript:void(0);">
		<div class="filter-wrap">
			<dl class="clearfix invest-filter">
				<dt>商品名</dt>
				<dd class="clearfix">
					<div class="col-sm-4 mb20">
						<div class="input-group">
							<input type="text" name="goodsName" value="${paramMap.goodsName}" class="form-control" placeholder="请输入商品名关键词">
							<span class="input-group-btn">
								<button class="btn btn-primary" type="button" onclick="javascript:queryAdminGoodsList(1);">搜索</button>
							</span>
						</div>
					</div>
				</dd>
			</dl>
		</div>
	</form>
</div>
<c:choose>
<c:when test="${!empty dataList && fn:length(dataList) ne 0}">
<table class="table">
	<thead>
		<tr>
			<th width="30%">商品名称</th>
			<th width="10%">商品原价</th>
			<th width="10%">运费</th>
			<th width="10%">虚构数量</th>
			<th width="30%">可选属性</th>
			<th width="10%">操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="goods" items="${dataList}" varStatus="index">
		<tr>
			<td class="title">
				<a href="<%=path %>/admin/goods/view/${goods.goodsId}" target="_blank">${goods.goodsName}</a>
			</td>
			<td>${goods.goodsPrice}</td>
			<td>${goods.deliveryFee}</td>
			<td>${goods.unrealNum}</td>
			<td>${goods.goodsProperties}</td>
			<td>
				<a href="javascript:deleteGoodsById('${goods.goodsId}')" target="_blank">删除</a>
				<a href="<%=path %>/admin/goods/toUpdate/${goods.goodsId}" target="_blank">修改</a>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<!-- 分页 -->
<p:pagination pageNo="${paramMap.pageNo}" pageCount="${paramMap.pageCount}" queryFunction="queryAdminGoodsList" style="text-center"></p:pagination>
<!-- 分页 end -->
</c:when>
<c:otherwise>
	<table class="table">
		<thead>
			<tr>
				<th width="30%">商品名称</th>
				<th width="10%">商品原价</th>
				<th width="10%">运费</th>
				<th width="10%">虚构数量</th>
				<th width="30%">可选属性</th>
				<th width="10%">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td colspan="3" align="center">
					暂无数据
				</td>
			</tr>
		</tbody>
	</table>
</c:otherwise>
</c:choose>